3.163 \(\int \csc ^3(e+f x) (a+b \sin (e+f x))^2 \, dx\)

Optimal. Leaf size=59 \[ -\frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {a^2 \cot (e+f x) \csc (e+f x)}{2 f}-\frac {2 a b \cot (e+f x)}{f} \]

[Out]

-1/2*(a^2+2*b^2)*arctanh(cos(f*x+e))/f-2*a*b*cot(f*x+e)/f-1/2*a^2*cot(f*x+e)*csc(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2789, 3767, 8, 3012, 3770} \[ -\frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {a^2 \cot (e+f x) \csc (e+f x)}{2 f}-\frac {2 a b \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^3*(a + b*Sin[e + f*x])^2,x]

[Out]

-((a^2 + 2*b^2)*ArcTanh[Cos[e + f*x]])/(2*f) - (2*a*b*Cot[e + f*x])/f - (a^2*Cot[e + f*x]*Csc[e + f*x])/(2*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2789

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[(2*c*d)/b
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc ^3(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc ^2(e+f x) \, dx+\int \csc ^3(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a^2 \cot (e+f x) \csc (e+f x)}{2 f}+\frac {1}{2} \left (a^2+2 b^2\right ) \int \csc (e+f x) \, dx-\frac {(2 a b) \operatorname {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}\\ &=-\frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {2 a b \cot (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc (e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.47, size = 133, normalized size = 2.25 \[ \frac {a^2 \left (-\csc ^2\left (\frac {1}{2} (e+f x)\right )\right )+a^2 \sec ^2\left (\frac {1}{2} (e+f x)\right )+4 a^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )-4 a^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+8 a b \tan \left (\frac {1}{2} (e+f x)\right )-8 a b \cot \left (\frac {1}{2} (e+f x)\right )+8 b^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )-8 b^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{8 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^3*(a + b*Sin[e + f*x])^2,x]

[Out]

(-8*a*b*Cot[(e + f*x)/2] - a^2*Csc[(e + f*x)/2]^2 - 4*a^2*Log[Cos[(e + f*x)/2]] - 8*b^2*Log[Cos[(e + f*x)/2]]
+ 4*a^2*Log[Sin[(e + f*x)/2]] + 8*b^2*Log[Sin[(e + f*x)/2]] + a^2*Sec[(e + f*x)/2]^2 + 8*a*b*Tan[(e + f*x)/2])
/(8*f)

________________________________________________________________________________________

fricas [B]  time = 0.47, size = 129, normalized size = 2.19 \[ \frac {8 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 2 \, a^{2} \cos \left (f x + e\right ) - {\left ({\left (a^{2} + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a^{2} - 2 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a^{2} - 2 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

1/4*(8*a*b*cos(f*x + e)*sin(f*x + e) + 2*a^2*cos(f*x + e) - ((a^2 + 2*b^2)*cos(f*x + e)^2 - a^2 - 2*b^2)*log(1
/2*cos(f*x + e) + 1/2) + ((a^2 + 2*b^2)*cos(f*x + e)^2 - a^2 - 2*b^2)*log(-1/2*cos(f*x + e) + 1/2))/(f*cos(f*x
 + e)^2 - f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)2/f*((4*tan((f*x+exp(1))/2)^2*a^2+32*tan((f*x+exp(1))/2)*b*a)/64+(-12*tan((f*x+exp(1))/2)^2*b^2-6*tan((f*x
+exp(1))/2)^2*a^2-8*tan((f*x+exp(1))/2)*b*a-a^2)*1/16/tan((f*x+exp(1))/2)^2+(2*b^2+a^2)/4*ln(abs(tan((f*x+exp(
1))/2))))

________________________________________________________________________________________

maple [A]  time = 0.37, size = 82, normalized size = 1.39 \[ -\frac {a^{2} \cot \left (f x +e \right ) \csc \left (f x +e \right )}{2 f}+\frac {a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2 f}-\frac {2 a b \cot \left (f x +e \right )}{f}+\frac {b^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^3*(a+b*sin(f*x+e))^2,x)

[Out]

-1/2*a^2*cot(f*x+e)*csc(f*x+e)/f+1/2/f*a^2*ln(csc(f*x+e)-cot(f*x+e))-2*a*b*cot(f*x+e)/f+1/f*b^2*ln(csc(f*x+e)-
cot(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 89, normalized size = 1.51 \[ \frac {a^{2} {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - 2 \, b^{2} {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {8 \, a b}{\tan \left (f x + e\right )}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/4*(a^2*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) + log(cos(f*x + e) - 1)) - 2*b^2*(log(co
s(f*x + e) + 1) - log(cos(f*x + e) - 1)) - 8*a*b/tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 6.49, size = 92, normalized size = 1.56 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}+\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {a^2}{2}+b^2\right )}{f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a^2}{8}+b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,a\right )}{f}+\frac {a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x))^2/sin(e + f*x)^3,x)

[Out]

(a^2*tan(e/2 + (f*x)/2)^2)/(8*f) + (log(tan(e/2 + (f*x)/2))*(a^2/2 + b^2))/f - (cot(e/2 + (f*x)/2)^2*(a^2/8 +
a*b*tan(e/2 + (f*x)/2)))/f + (a*b*tan(e/2 + (f*x)/2))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (e + f x \right )}\right )^{2} \csc ^{3}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**3*(a+b*sin(f*x+e))**2,x)

[Out]

Integral((a + b*sin(e + f*x))**2*csc(e + f*x)**3, x)

________________________________________________________________________________________